package com.ruoyi.common.utils.http;


import com.ruoyi.common.utils.http.ftp.node.impl.MixedNode;
import com.ruoyi.common.utils.http.ftp.pool.FTPTemplate;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Component;


import java.io.File;

import java.util.List;

@Component
public class FTPUtil {
    private static FTPTemplate ftpTemplate;
    @Autowired
    private void setFtpTemplate(FTPTemplate ftpTemplate){
        FTPUtil.ftpTemplate=ftpTemplate;
    }

    public static boolean uploadFile(String ftpPath, List<File> fileList) throws Exception {
        return  ftpTemplate.uploadFile(ftpPath,fileList);
    }
    public static MixedNode listFile(String dir) throws Exception {
        return ftpTemplate.listFile(dir);
    }
}
